<?php /* Template Name: Klienti VTP */ ?>
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
get_header();
?>
<?php
$cats = $vtpClients->types;
$current = 1;
if (isset($_GET['category'])) {
    $current = intval($_GET['category']);
}
?>
<div id="categoryMenu">
    <ul>
        <li><a href="<?php echo get_permalink().'&category=1' ?>" class="<?php echo ($current==1?'current':'') ?>"><?php echo $cats[1] ?></a></li>
        <li><a href="<?php echo get_permalink().'&category=2' ?>" class="<?php echo ($current==2?'current':'') ?>"><?php echo $cats[2] ?></a></li>
    </ul>
</div>
<div class="clearer"></div>
<?php

$clients = $vtpClients->getClients($current);
// vsetci klienti
echo '<h2>Klienti VTP</h2>';
echo '<hr class="h2hr" /><div class="clearer"></div>';
echo '<table id="usersTable">';
echo '<tr>';
for ($i = 0; $i < count($clients); $i++) {
    $cl = $clients[$i];
    echo '<td>';
    echo '<div class="user">';

    echo '<table>';
    echo '<tr>';
    echo '<td class="photo">';
    echo '<a href="'.get_bloginfo('url').'/?author='.$cl->ID.'">';
    $vtpClients->getPhoto($cl->ID);
    echo '</a>';
    echo '</td>';
    echo '<td class="info">';
    echo $cl->name.'<br />';
    echo '<a href="mailto:'.$cl->user_email.'">';
    echo $cl->user_email.'<br />';
    echo '</a>';
    echo $cl->phone1.'<br />';
    echo '<a href="'.$cl->user_url.'" target="_blank">';
    echo $cl->user_url.'<br />';
    echo '</a>';
    echo '</td>';
    echo '</tr>';
    echo '</table>';

    echo '</div>';
    echo '</td>';
    if ($i % 2 == 1) {
        echo '</tr><tr>';
    }
}
if (count($clients) % 2 == 1) {
    echo '<td>&nbsp;</td>';
}
echo '</tr>';
echo '</table>';

?>
<?php
get_footer();
?>
